package com.keyancompany.zhongbaopingtai.weight;

import android.content.Context;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.keyancompany.zhongbaopingtai.R;
import com.keyancompany.zhongbaopingtai.adapter.IndexTeamAdapter;
import com.keyancompany.zhongbaopingtai.fragment.TeamFragment;
import com.keyancompany.zhongbaopingtai.utils.ScreenUtils;

/**
 * Created by firefox on 2016/8/13.
 */
public class IndexTeamPopup extends MenuPopuWindow {
    //    private List<TeamUser> list;
    IndexTeamAdapter adapter;

    public IndexTeamPopup(Context context) {
        super(context);
    }

    private ListView listView;

    @Override
    public void setUpViews() {
        listView = (ListView) findViewById(R.id.index_team_list);
        adapter = new IndexTeamAdapter(context, TeamFragment.list);
        listView.setAdapter(adapter);

    }

    @Override
    public void setUpListener() {
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

                if (cliclSureListener != null)
                    cliclSureListener.clickSureLinstener(position + "");

                dismiss();
//          IntentUtils.startActivity(ctx,TeamIndexActivity.class, Constants.CHOSE_TEAM,base);
            }
        });
    }

    @Override
    public int getAnimationStyle() {
        return 0;
    }

    @Override
    public int getResView() {
        return R.layout.popup_task_label;
    }

    @Override
    public void updateView(View contentView) {
        setWidth(ScreenUtils.getScreenWidth(context) * 2 / 3);
        setHeight(ScreenUtils.getScreenHeight(context) * 2 / 3);
    }
}
